#ifndef GP_LIST_H
#define GP_LIST_H
#include "list.h"

typedef struct gp_node{ // 通用节点
	struct list_head entry;
	void *addr;
}gp_node_t;

#define list_destroy(head, user_struct, member) \
do{ \
	assert(head);  \
	typeof(user_struct) *cur, *next; \
	list_for_each_entry_safe(cur, next, head, member){ \
		list_del(&cur->member); \
		free(cur);  \
	} \
}\
while(0)

void gp_node_add_tail(void *node_addr, struct list_head *head);
void gp_node_delete_tail(struct list_head *head);
void gp_list_free(struct list_head *head);
void gp_list_del_node(void *addr, struct list_head *head);
#endif